// pages/classify/classify.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    asideBar:["卡片、证件","生活用品","数码产品","美妆护肤","衣服物品","饰品","文娱","其他"],
    rightList: [
      [
        {
          url: "../../images/classify_icon/shenfz.png",
          text: "身份证"
        },
        {
          url: "../../images/classify_icon/xiaoyk.png",
          text: "校园卡"
        },
        {
          url: "../../images/classify_icon/xuesz.png",
          text: "学生证"
        },
        {
          url: "../../images/classify_icon/shuika.png",
          text: "水卡"
        },
        {
          url: "../../images/classify_icon/gongjk.png",
          text: "公交卡"
        },
        {
          url: "../../images/classify_icon/yinghk.png",
          text: "银行卡"
        },
        {
          url: "../../images/classify_icon/qitaka.png",
          text: "其它卡片"
        },
     
      ],
      [
        {
          url: "../../images/classify_icon/shuibei.png",
          text: "水杯"
        },
        {
          url: "../../images/classify_icon/yusan.png",
          text: "雨伞"
        },
        {
          url: "../../images/classify_icon/riyongp.png",
          text: "日用品"
        },
        {
          url: "../../images/classify_icon/yaoshi.png",
          text: "钥匙/钥匙扣"
        },
        {
          url: "../../images/classify_icon/qita.png",
          text: "其它"
        },
      ],
      [
        {
          url: "../../images/classify_icon/shouji.png",
          text: "手机"
        },
        {
          url: "../../images/classify_icon/xiangji.png",
          text: "相机"
        },
        {
          url: "../../images/classify_icon/Upan.png",
          text: "U盘"
        },
        {
          url: "../../images/classify_icon/chongdianbao.png",
          text: "充电宝"
        },
        {
          url: "../../images/classify_icon/pad.png",
          text: "平板电脑"
        },
        {
          url: "../../images/classify_icon/mouse.png",
          text: "鼠标"
        },
        {
          url: "../../images/classify_icon/charge.png",
          text: "充电线"
        },
        {
          url: "../../images/classify_icon/erji.png",
          text: "耳机"
        },
        {
          url: "../../images/classify_icon/bi.png",
          text: "手写笔"
        },
        {
          url: "../../images/classify_icon/zhijia.png",
          text: "支架"
        },
        {
          url: "../../images/classify_icon/yinxiang.png",
          text: "音箱"
        },
        {
          url: "../../images/classify_icon/MP3.png",
          text: "MP3"
        },
        {
          url: "../../images/classify_icon/qita.png",
          text: "其它"
        },
      ],
      [
        {
          url: "../../images/classify_icon/kouhong.png",
          text: "口红"
        },
        {
          url: "../../images/classify_icon/fendi.png",
          text: "粉底"
        },
        {
          url: "../../images/classify_icon/meibi.png",
          text: "眉笔"
        },
        {
          url: "../../images/classify_icon/saihong.png",
          text: "腮红"
        },
        {
          url: "../../images/classify_icon/yanying.png",
          text: "眼影"
        },
        {
          url: "../../images/classify_icon/fangshai.png",
          text: "防晒"
        },
        {
          url: "../../images/classify_icon/penwu.png",
          text: "喷雾"
        },
        {
          url: "../../images/classify_icon/xiangshui.png",
          text: "香水"
        },
        {
          url: "../../images/classify_icon/xiangshui.png",
          text: "其它"
        },
      ],
      [
        {
          url: "../../images/classify_icon/yifu.png",
          text: "男装"
        },
        {
          url: "../../images/classify_icon/yifu.png",
          text: "女装"
        },
        {
          url: "../../images/classify_icon/yifu.png",
          text: "男鞋"
        },
        {
          url: "../../images/classify_icon/yifu.png",
          text: "女鞋"
        },
        {
          url: "../../images/classify_icon/yifu.png",
          text: "包包"
        },
        {
          url: "../../images/classify_icon/yifu.png",
          text: "其它"
        },
      ],
      [
        {
          url: "../../images/classify_icon/shipin.png",
          text: "手表"
        },
        {
          url: "../../images/classify_icon/shipin.png",
          text: "项链"
        },
        {
          url: "../../images/classify_icon/shipin.png",
          text: "手链"
        },
        {
          url: "../../images/classify_icon/shipin.png",
          text: "戒指"
        },
        {
          url: "../../images/classify_icon/shipin.png",
          text: "耳饰"
        },
        {
          url: "../../images/classify_icon/shipin.png",
          text: "眼镜"
        },
        {
          url: "../../images/classify_icon/shipin.png",
          text: "帽子"
        },
        {
          url: "../../images/classify_icon/shipin.png",
          text: "发饰"
        },
        {
          url: "../../images/classify_icon/shipin.png",
          text: "其它"
        },
      ],
      [
        {
          url: "../../images/classify_icon/yundong.png",
          text: "教材"
        },
        {
          url: "../../images/classify_icon/yundong.png",
          text: "笔记"
        },
        {
          url: "../../images/classify_icon/yundong.png",
          text: "文具"
        },
        {
          url: "../../images/classify_icon/yundong.png",
          text: "球拍"
        },
        {
          url: "../../images/classify_icon/yundong.png",
          text: "护具"
        },
        {
          url: "../../images/classify_icon/yundong.png",
          text: "跳绳"
        },
        {
          url: "../../images/classify_icon/yundong.png",
          text: "自行车"
        },
        {
          url: "../../images/classify_icon/yundong.png",
          text: "棋牌"
        },
        {
          url: "../../images/classify_icon/yundong.png",
          text: "其它"
        },
      ],
      [
        {
          url: "../../images/classify_icon/yaopin.png",
          text: "药品"
        },
        {
          url: "../../images/classify_icon/yaopin.png",
          text: "零食"
        },
        {
          url: "../../images/classify_icon/yaopin.png",
          text: "周边"
        },
        {
          url: "../../images/classify_icon/yaopin.png",
          text: "其他"
        },
      ],
    ],
    select: 0,
  },

  toClassifyList(e){
    const { text } = e.currentTarget.dataset;
    wx.navigateTo({
      url: `../classifyList/classifyList?text=${text}&from=classify`,
    })


  },

  selectLeft(e){
     const { index } = e.currentTarget.dataset;
     this.setData({
       select: index
     })
  },
  toSearch(){
    wx.navigateTo({
      url: '../search/search',
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {


  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {
    if (typeof this.getTabBar === 'function' && this.getTabBar()){
      this.getTabBar().setData({
         select: 1
      })
   }

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})